#include "include/publisher.h"
#include <iostream>
#include <memory>

using namespace std;

int main()
{
    unique_ptr<publisher> pub = make_unique<publisher>();
    unique_ptr<observer> ob1 = make_unique<observer>("ob1", std::move(pub));
    unique_ptr<observer> ob2 = make_unique<observer>("ob2", std::move(pub));
    unique_ptr<observer> ob3 = make_unique<observer>("ob3", std::move(pub));
    pub->notify();
    cout<<"=========================ob3取消订阅============================="<<endl;
    ob3->cancleSubscribing();
    pub->notify();
}